package com.tiany.java_study_exercise.BankTest;

public class Account {
    private double balance;

    public Account(double init_balance){
        this.balance=init_balance;
    }

    public double getBalance() {
        return balance;
    }

    //存款
    public  void deposit(double amt){
        if (amt >=0) {
            balance += amt;
            System.out.println("存款成功，当前余额为：" + balance);
        }else System.out.println("请确保输入正确");
    }
    //取钱
    public void withdraw(double amt){
        if (amt >=0) {
            balance -= amt;
            System.out.println("取款成功，当前余额为：" + balance);
        }else System.out.println("请确保输入正确");
    }
}
